import java.util.Random;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 晓星航
 * Date: 2022-10-08
 * Time: 14:51
 */
public class TestDemo1 {
    public static void main19(String[] args) {
        for (int n = 1; n <= 100 ; n++) {
            int i = 2;
            for (i = 2; i <= Math.sqrt(n); i++) {
                if (n % i == 0){
                    break;
                }
            }
            if (i > Math.sqrt(n)) {
                System.out.println(n);
            }
        }
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int i = 2;
        for (i = 2; i <= Math.sqrt(n); i++) {
            if (n % i == 0){
                System.out.println(n + "不是素数！");
                break;
            }
        }
        if (i > Math.sqrt(n)) {
            System.out.println(n + "是素数！");
        }
    }
    public static void main17(String[] args) {
        for (int n = 1000; n <=2000 ; n++) {
            if(n%4==0&&n%100!=0||n%400==0){
                System.out.println(n);
            }
            else{
            }
        }
    }
    public static void main16(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        if (n < 0) {
            System.out.println("请输入大于0~55的数字");
        } else if (n >=0 && n <= 18) {
            System.out.println("少年");
        } else if (n > 18 && n <= 28) {
            System.out.println("青年");
        } else if (n > 28 && n <= 55) {
            System.out.println("老年");
        } else {
            System.out.println("输入错误，请输入0~55的数字");
        }
    }

    public static void main11(String[] args) {
            Scanner sc = new Scanner(System.in);
            System.out.println("请输入你的姓名：");
            String name = sc.nextLine();
            System.out.println("请输入你的年龄：");
            int age = sc.nextInt();
            System.out.println("请输入你的工资：");
            float salary = sc.nextFloat();
            System.out.println("你的信息如下：");
            System.out.println("姓名: "+name+"\n"+"年龄："+age+"\n"+"工资："+salary);
            sc.close(); // 注意, 要记得调用关闭方法
    }
    public static void main10(String[] args) {
        Random random = new Random();
        int rand = random.nextInt(100);
        Scanner scanner = new Scanner(System.in);
        while(true){
            System.out.println("请输入一个数字：->");
            int n = scanner.nextInt();
            if (n > rand){
                System.out.println("猜大了！");
            } else if (n < rand){
                System.out.println("猜小了！");
            } else {
                System.out.println("猜对了！");
                break;
            }
        }
    }
    public static void main7(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你的姓名：");
        String name = sc.nextLine();
        System.out.println("请输入你的年龄：");
        int age = sc.nextInt();
        System.out.println("请输入你的工资：");
        float salary = sc.nextFloat();
        System.out.println("你的信息如下：");
        System.out.println("姓名: "+name+"\n"+"年龄："+age+"\n"+"工资："+salary);
        sc.close(); // 注意, 要记得调用关闭方法
    }
    public static void main6(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int i = 0;
        int num = 1;
        int sum = 0;
        for (i = 1; i <= n; i++){
            num *= i;
            sum += num;
        }
        System.out.println(num);
        System.out.println(sum);
    }
    public static void main8(String[] args) {
        Random random = new Random();
        int rand = random.nextInt(100);
        Scanner scanner = new Scanner(System.in);

        while(true){
            System.out.println("请输入你要猜的数字：");
            int n = scanner.nextInt();
            if(n < rand) {
                System.out.println("猜小了");
            }else if(n == rand) {
                System.out.println("猜对了");
                break;
            }else {
                System.out.println("猜大了");
            }
        }
    }
    public static void main5(String[] args) {
        int num = 100;
        while (num <= 200) {
            if (num % 3 != 0) {
                num++; // 这里的 ++ 不要忘记! 否则会死循环.
                continue;
            }
            System.out.println("找到了 3 的倍数, 为:" + num);
            num++;
        }
    }
    public static void main4(String[] args) {
        int num = 100;
        while (num <= 200) {
            if (num % 3 == 0) {
                System.out.println("找到了 3 的倍数, 为:" + num);
                break;
            }
            num++;
        }
    }
    public static void main3(String[] args) {
        int n = 1;
        while (n <= 100){
            if (n % 3 == 0){
                System.out.println(n);
                n++;
                continue;
            }
            n++;
        }
    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int i = 1;
        int num = 1;
        int sum = 0;
        while(i<=n){
            num *= i;
            i++;
            sum += num;
        }
        System.out.println(num);
        System.out.println(sum);
    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int num = 0;
        while (n<=100) {
            num += n;
            n++;
        }
        System.out.println(num);
    }
}
